<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-show指令</title>
</head>

<body>
    <div id="app">
        <input type="button" @click="show" value="点击隐藏或显示"/>
        <!-- v-show指令 语法：v-show="真假表达式" 根据表达式的真假显示或者隐藏内容，设置display完成隐藏和显示 -->
        <h1 style="color: cadetblue;" v-text="message" v-show="isShow"></h1>
        <img src="./image/1.jpg" v-show="isShow" />
    </div>
    <script src="./js/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                message:"今天有点冷",
                isShow:false
            },
            methods:{
                show(){
                    this.isShow = !this.isShow
                }
            }
        })
    </script>
</body>

</html>